home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Broderbund Demo / DemoData / _menu.Dxr / 00003_NavigationMgr.ls < prev    next >
Encoding:
Text File  |  1997-09-03  |  2.0 KB  |  87 lines

  1. property myParams, currentMarker
  2.  
  3. on new me
  4.   set myParams to [:]
  5.   return me
  6. end
  7.  
  8. on addMarker me, marker, buttonList, buttonDownList, transition
  9.   set newProp to [:]
  10.   setaProp(newProp, #buttons, buttonList)
  11.   setaProp(newProp, #buttonDownStates, buttonDownList)
  12.   setaProp(newProp, #transition, transition)
  13.   setaProp(myParams, marker, newProp)
  14. end
  15.  
  16. on setMarker me, marker
  17.   if not voidp(getaProp(myParams, marker)) then
  18.     set currentMarker to marker
  19.   else
  20.     set currentMarker to EMPTY
  21.   end if
  22. end
  23.  
  24. on getMarker me
  25.   return currentMarker
  26. end
  27.  
  28. on getObjectList me
  29.   if not voidp(getaProp(myParams, currentMarker)) then
  30.     set theProp to getProp(myParams, currentMarker)
  31.     set theObjectList to getProp(theProp, #buttons)
  32.   end if
  33.   return theObjectList
  34. end
  35.  
  36. on goMarker me, marker
  37.   if currentMarker = marker then
  38.     exit
  39.   end if
  40.   if not voidp(getaProp(myParams, currentMarker)) then
  41.     set oldProp to getProp(myParams, currentMarker)
  42.     set oldButtonList to getProp(oldProp, #buttons)
  43.   else
  44.     set oldButtonList to []
  45.   end if
  46.   if not voidp(getaProp(myParams, marker)) then
  47.     set theProp to getProp(myParams, marker)
  48.     set buttonList to getProp(theProp, #buttons)
  49.     set buttonDownList to getProp(theProp, #buttonDownStates)
  50.     set trans to getProp(theProp, #transition)
  51.     repeat with b in oldButtonList
  52.       if getOne(buttonList, b) = 0 then
  53.         tell b
  54.           setState(b, 0)
  55.         end tell
  56.         next repeat
  57.       end if
  58.       tell b
  59.         suspend(b)
  60.       end tell
  61.     end repeat
  62.     if not voidp(trans) then
  63.       do("puppetTransition" && trans)
  64.     end if
  65.     go(marker)
  66.     set currentMarker to marker
  67.     repeat with n = 1 to count(buttonList)
  68.       set b to getAt(buttonList, n)
  69.       if getOne(oldButtonList, b) = 0 then
  70.         tell b
  71.           setRadio(b, getAt(buttonDownList, n))
  72.         end tell
  73.         tell b
  74.           setState(b, 1)
  75.         end tell
  76.         next repeat
  77.       end if
  78.       tell b
  79.         unsuspend(b)
  80.       end tell
  81.     end repeat
  82.   end if
  83.   if the freeBlock < (200 * 1024) then
  84.     unLoad()
  85.   end if
  86. end
  87.